import { viteVConsole } from 'vite-plugin-vconsole'
import { resolve } from 'path'

export default function createVconsole(env: Record<string, any>): any {
  const { VITE_APP_ENV } = env
  return viteVConsole({
    entry: resolve('src/main.ts'),
    localEnabled: true, // 本地开发环境是否启用标识
    enabled: VITE_APP_ENV === 'development', // 打包是否启用标识
    config: {
      maxLogNumber: 1000,
      theme: 'dark',
    },
  })
}
